package com.chaodev.base.model;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;
import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * @author zyf
 * @description 轮播图实体类
 * @date 2023-09-20 10:45
 */
@Data
public class LunBo implements Serializable {
    private static final long serialVersionUID = 250827374996633232L;

    @ApiModelProperty("主键")
    private Integer id;

    @ApiModelProperty("图片类型（字典）")
    private String picType;

    @ApiModelProperty("轮播图名称")
    private String picName;

    @ApiModelProperty("轮播图路径")
    private String picUrl;

    @ApiModelProperty("轮播图点击跳转地址")
    private String picLink;

    @ApiModelProperty("排序优先级（越小越靠前）")
    private Integer sort;

    @ApiModelProperty("有效状态（1有效 0无效）")
    private Integer state;

    @ApiModelProperty("创建时间")
    @JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createTime;

    @ApiModelProperty("创建人")
    private String createUser;

    @Override
    public String toString() {
        return "{" +
                "\"id\":" + id +
                ",\"picType\":" + (picType == null ? null : "\"" + picType + "\"") +
                ",\"picName\":" + (picName == null ? null : "\"" + picName + "\"") +
                ",\"picUrl\":" + (picUrl == null ? null : "\"" + picUrl + "\"") +
                ",\"picLink\":" + (picLink == null ? null : "\"" + picLink + "\"") +
                ",\"sort\":" + sort +
                ",\"state\":" + state +
                ",\"createTime\":" + (createTime == null ? null : "\"" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(createTime) + "\"") +
                ",\"createUser\":" + (createUser == null ? null : "\"" + createUser + "\"") +
                "}";
    }
}
